<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/7/29
  Time: 9:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>

  <link rel="stylesheet" href="../static/lib/layui-v2.6.8/layui/css/layui.css">
  <title>Title</title>

</head>
<body>

<%--start行内部工具栏--%>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<%--end行内部工具栏--%>


<%--start编辑用户弹出窗口--%>


<div id="windoedit" style="display: none; padding: 20px" lay-filter="editStaffForm" class="layui-form">
  <input type="hidden" name="id">
  <div class="layui-form-item">
    <label class="layui-form-label">用户名</label>
    <div class="layui-input-inline">
      <input type="text" name="username" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
    </div>
  </div>
</div>

<%--end编辑用户弹出窗口--%>

<%-- start 用户数据列表展示   --%>
<table class="layui-table" lay-data="{ url:'../staff/list', page:true, id:'datalist',toolbar:'#toptoolbar'}" lay-filter="datalist">
  <thead>
  <tr>
    <th lay-data="{field:'id', width:80, sort: true}">ID</th>
    <th lay-data="{field:'code', width:80, sort: true}">职工编码</th>
    <th lay-data="{field:'name', }">职工名</th>
    <th lay-data="{field:'sex', sort: true}">性别</th>
    <%--        <th lay-data="{ sort: true,templet:'#userStateText'}">状态</th>--%>
    <th lay-data="{field:'birthday', sort: true,}">生日</th>
    <th lay-data="{field:'department_id', sort: true,}" id="dep">所在部门</th>
    <th lay-data="{ sort: true,templet:'#staffStateText'}">状态</th>
    <th lay-data="{field:'操作',toolbar:'#barDemo'}">操作</th>
  </tr>
  </thead>
</table>
<%--end用户数据列表展示--%>




<%--START用户状态文本显示--%>
<script type="text/html" id="staffStateText">
    {{# if(d.userstate==0){   }}
        <span style="color: #00F7DE">刚入职</span>
    {{#  }else if(d.userstate==1){   }}
    <span style="color: #1dc797">正常</span>
    {{#  }else if(d.userstate==2){      }}
    <span style="color: red">离职</span>
    {{#  }   }}
</script>
<%--END用户状态文本显示--%>

<%--start新增用户弹出窗口--%>
<div id="windo" style="display: none; padding: 20px" lay-filter="addStaffForm" class="layui-form">
  <div class="layui-form-item">
    <label class="layui-form-label">员工编码</label>
    <div class="layui-input-inline">
      <input type="text" name="code"  required lay-verify="required" placeholder="请输入用户编码" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">员工名</label>
    <div class="layui-input-inline">
      <input type="text" name="name"  required lay-verify="required" placeholder="请输入员工名" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">性别</label>
    <div class="layui-input-inline">
      <input type="radio" checked name="sex" value="男" id="sex0"><label for="sex0">男</label>
      <input type="radio" name="sex" value="女" id="sex1"><label for="sex1">女</label>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">生日</label>
    <div class="layui-input-inline">
      <input type="datetime-local" name="birthday"  required lay-verify="required" placeholder="请输入生日" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">所属部门</label>
    <div class="layui-input-inline">
      <select name="department_name" lay-verify="" style=""></select>
    </div>
  </div>
</div>

<%--end新增用户弹出窗口--%>


<%--start表头工具栏--%>
<script type="text/html" id="toptoolbar">
  <div class="layui-form-item">
    <div class="layui-inline">
      <div class="layui-input-inline">
        <input type="text" name="checktext" class="layui-input">
      </div>
      <button class="layui-btn layui-btn" lay-event="check">查询</button>
      <button class="layui-btn" lay-event="add">新增</button>
    </div>
  </div>
</script>
<%--end表头工具栏--%>



<script src="../static/lib/layui-v2.6.8/layui/layui.js"></script>
<script src="../static/js/StaffList.js"></script>

</body>
</html>
